-- CALC_SHIP_ATTACK

-- 计算幽灵船攻击
-- @param ship    幽灵船
return function(ship, fix)
    local level = ship:queryAttrib("level");
    local attack = level * 2 + 18;
    --野生幽灵船，按怪物属性计算
    if not ship:isHired() then
        local dungeonId = DungeonM.getDungeonId();
        local layerFix  = DungeonAreaM.query(dungeonId, "layer_fix");
        local layer     = DungeonM.currentLayer();
        attack = FormulaM.invoke("CALC_DUNGEON_MONSTER_INIT_ATTACK", 12, layer, layerFix);

        -- 被变形术削弱
        local prop = PropM.combine(ship, "transfiguration", 1);
        attack = PropM.apply(prop, attack);

        return attack;
    end

    -- 1. 攻击+N%
    local prop = PropM.combine(ship, "attrib", "attack");
    attack = PropM.apply(prop, attack);

    -- 2. 攻击+N
    prop = PropM.combine(ship, "attrib2", "attack");
    attack = PropM.apply(prop, attack);

    -- 幽灵船能力增强
    prop = PropM.combine(ME.user, "attrib_ship", "attack");
    attack = PropM.apply(prop, attack);

    return attack;
end
